#!/usr/bin/env sh

USAGE="Usage: `basename $0` file"
if [ $# -lt 1 ] ; then
echo "$USAGE"
exit 1
fi

for i in "$@" ; do
	if [ -f "$i" ] ; then
		iconv -f GB18030 -t UTF-8 "$i" -o /tmp/gb-utf.txt
		rm "$i"
		mv /tmp/gb-utf.txt "$i"
	else
		echo "ERROR: "$i" not a file"
	fi
done


